package com.integration.test.a;

import com.integration.maven.service2controllerProcessor.annotation.EnableService2RestController;
import com.integration.test.UserDto;
import com.integration.test.UserService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author ckk
 * @Date 2020/12/24 14:01
 * @Description 功能描述:
 **/
@RestController
@RequestMapping("/user")
public class UserController1 {

    @Autowired
    UserService userService;

    @Autowired
    UserService1 userService1;

    @GetMapping("/insertUser")
    public UserDto loginShop(@ParamAnnotation(name = "minngc", url = "/123123123", no = {"1","2"}) @RequestBody UserDto userDto,
                             String name){
        return userService.insertUser(userDto,name );
    }


    /**
    *    @PostMapping("/updateUser")
     *     @Dto(dtoClass = UserDto.class)
     *     public Boolean updateUser(String name, String no);
    */


    @PostMapping("/updateUser")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userDto", paramType = "body", required = true,
                    value = "{\n\n" +
                            "    \"name\":\"名称\",\n" +
                            "    \"no\":\"编号\"\n" +
                            "\n\n}")
    })
    public Boolean updateUser(@RequestBody UserDto userDto){
        return userService.updateUser(userDto.getName(),userDto.getNo() );
    }

}
